<template>
    <li>
        <div class="toto-container">
            <input type="checkbox" v-model="todoItem.done">
            <span>{{ todoItem.title }}</span>
        </div>
        <button @click="handleDelTodo(todoItem.id)" class="btn-del">删 除</button>
    </li>
</template>

<script>
export default {
    name: "MyItem",
    props: ['todoItem'],
    methods: {
        handleDelTodo(id){
            this.$bus.$emit('delTodo',id,1,2,3,4)
        }
    },
}
</script>

<style scoped>

input{
    float: left;
    margin-left: 10px;
    height: 40px;
}

span{
    float: left;
    margin-left: 10px;
    height: 40px;
}

button{
    float: right;
    margin-right: 10px;
    height: 40px;
    width: 50px;
    background-color: red;
    color: white;
    border: 0px;
    border-radius: 5px;
}

li{
    height: 40px;
    line-height: 40px;
    display: block;
}

li .btn-del {
    display: none;
}


li:hover .btn-del {
    display: block;
}
</style>